package com.asl.website.contactInfo.domain;

import com.asl.website.common.Language;

/**
 * @author 482944566@qq.com
 * @version 1.0
 * @date 2025-05-21
 */

public class SysContactInfoDTO {
    private String companyName;
    private String logisticsPhone;
    private String officePhone;
    private String email;
    private String address;
    private String language;

    public SysContactInfoDTO(SysContactInfo contactInfo, String language) {
        this.language = language;

        switch (Language.fromCode(language)) {
            case EN_US:
                this.companyName = contactInfo.getCompanyNameEn();
                this.logisticsPhone = contactInfo.getLogisticsPhoneEn();
                this.officePhone = contactInfo.getOfficePhoneEn();
                this.email = contactInfo.getEmailEn();
                this.address = contactInfo.getAddressEn();
                break;
            case DE_DE:
                this.companyName = contactInfo.getCompanyNameDe();
                this.logisticsPhone = contactInfo.getLogisticsPhoneDe();
                this.officePhone = contactInfo.getOfficePhoneDe();
                this.email = contactInfo.getEmailDe();
                this.address = contactInfo.getAddressDe();
                break;
            default: // 默认中文
                this.companyName = contactInfo.getCompanyNameZh();
                this.logisticsPhone = contactInfo.getLogisticsPhoneZh();
                this.officePhone = contactInfo.getOfficePhoneZh();
                this.email = contactInfo.getEmailZh();
                this.address = contactInfo.getAddressZh();
        }
    }

    public String getCompanyName() {
        return companyName;
    }

    public String getLogisticsPhone() {
        return logisticsPhone;
    }

    public String getOfficePhone() {
        return officePhone;
    }

    public String getEmail() {
        return email;
    }

    public String getAddress() {
        return address;
    }

    public String getLanguage() {
        return language;
    }
}
